DESANTI = { };
( function ( D ) {
    D.defaultNbImages = 4;
    D.vocabs = { };
    D.classes = { };
    D.dragObject = { "type": null };

    // ./initClasses.js
    D.initClasses = { };

    // ./initViews.js
    D.initViews = { };

    // ./initRelations.js
    D.initRelations = { };

    // ./newLine.js
    D.newLine = { };

    // ./updateImages.js
    D.updateImages = { };

    // ./utilities.js
    D.userName = { };
    D.getDocHeight = { };
    D.disableSelection = { };

    // ./autocomplete.js
    D.autocomplete = { };

    // ./request.js
    D.request = { };

    // ./makeHideable.js
    D.makeHideable = { };

    // ./newRelations.js
    D.newRelations = { };

    // ./openPage.js
    D.openPage = { };

    // ./initCollections.js
    D.initCollections = {};

    // ./initFiles.js
    D.initFiles = {};

    window.onload = function( )
    {
        D.disableSelection( document.getElementById( "menu" ) );
        document.getElementById( "lines" ).style.height = ( D.getDocHeight() - 25 ) + "px";
        document.getElementById( "search" ).onclick = function( )
        {
            
            var url = self.location.protocol + "//" + self.location.hostname + "/collections.php",
                win = window.open( url, "collections" );

            win.focus( );
            return false;
        };
        document.getElementById( "couvertures" ).onclick = function( )
        {
            
            var url = self.location.protocol + "//" + self.location.hostname + "/couvertures.php",
                win = window.open( url, "couvertures" );

            win.focus( );
            return false;
        };

	document.getElementById( "traceBtn" ).onclick = function()
	{
		var url = self.location.protocol + "//" + self.location.hostname + "/trace.html",
			win = window.open( url, "trace" );
			
		win.focus();
		return false;
	}

        D.makeHideable( "selectOperation", [ "pagesOperations" ] );

	D.makeHideable( "trace", [ "traceBtn" ] );

	D.initCollections();
	D.initRelations();

	document.body.onmouseup = function(){
		D.dragObject = { "type": null };
	}

	// désactive la touche "Return"
	function checkCR(evt) {
      		var evt  = (evt) ? evt : ((event) ? event : null);
          	var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
	      	if ((evt.keyCode == 13) && (node.type=="text")) {return false;}

	}
	document.onkeypress = checkCR;
    }

} ) ( DESANTI );
